if( localStorage.getItem("areaCode") == "" || localStorage.getItem("areaCode") == undefined ){
	localStorage.setItem("areaName", "重庆市");
	localStorage.setItem("areaCode", 50);
}	
$(".city").text("当前选择城市: "+ localStorage.getItem("areaName"));
function cityList(){
	var display =$('#citylist').css('display');
	if(display == 'none'){
		var content = document.querySelector("#citylist"),
		contentHtml="<ul class=\"citylist\">";
		$.ajax({
			url: "http://118.25.235.213:8020/ChinaAPP/json/areaCode.json",
			type: "GET",
			dataType: "json", 
			success: function(data) {
		   		//console.log(data)
		   		data = data.childNode;
		   		for(i=0;i<data.length;i++){
					 contentHtml += "<li onclick=\"ChangeCity('"+ data[i].areaCode +"', '"+ data[i].areaName +"')\" title=\""+ data[i].areaName +"\">"+ data[i].areaName +"</li>";
					 if(i !== data.length){
						// contentHtml += "<div class=\"line\"></div>";
					 }
		   		}
		   		contentHtml += "</ul>"
		   		content.innerHTML = contentHtml;
		   		$("#citylist").slideDown(700);
			}
		});
	}else{
		$("#citylist").slideUp(700);
	}	
}

function ChangeCity(code, name){
    $("#citylist").slideUp(700);
    $(".city").text("当前选择城市: "+name);
	$(".city").attr("title", name);
	localStorage.setItem("areaCode", code);
	localStorage.setItem("areaName", name);
	getWeather(name);
	getAir(areaName);
	getPro1(code);
	getPro2(code);
	getPro3(code);
	getPro4(code);
	getPro5(code);
	getPro6(code);
}